<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->title;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
<!--时间选择器-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/lang/cn_utf8.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-setup.js"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/js/date/calendar-blue.css" />
<!--colorbox-->
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>
<style>
.subject{white-space:nowrap;}
.del{ text-decoration: line-through; color:red;}
.green{ color:#00CC33;}
.red{ color:#FF0000;}
</style>
</head>

<body>
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：<a href="<?php echo $this->projectUrl(array('action'=>'index'));?>">分支协议列表</a> &gt; <span id="focus">[<?php echo $this->vars['childVersion'];?>] <?php echo isset($this->fieldTypeRows[$this->vars['fieldType']]['nameNote']) ? $this->fieldTypeRows[$this->vars['fieldType']]['nameNote'] : '';?> (<?php echo $this->vars['fieldType'];?>) 页面ID列表</span></div>
			<div id="topOtherMenu">
				<input type="button" name="insert" id="insert" value="添加id" class="button" onclick="location.href='<?php echo $this->projectUrl(array('action'=>'child-page-id-insert','childVersion'=>$this->vars['childVersion'],'fieldType'=>$this->vars['fieldType'], 'backUrl'=>urlencode($this->pageUrl)));?>';" />
			</div>
		</div>
		<div id="body">
			<div id="search">
			</div>
			<div id="content" style="padding-top:5px;">
				<form id="listForm" name="listForm" method="post" action="">
					<table class="table">
						<tr class="subject">
							<td width="5%" class="checkBoxTd">选择</td>
							<td>页面ID</td>
							<td>页面名称</td>
							<td>页面类型</td>
							<td>是否需要埋点</td>
							<td>BI平台判定</td>
							<td>研发主管判定</td>
							<td>当前是否埋点</td>
							<td>是否锁定</td>
							<td>重要</td>
							<td>埋点时版本</td>
							<td>说明</td>
							<td>备注</td>
							<td width="10%" class="checkBoxTd">操作</td>
						</tr>
<?php foreach($this->rows as $row) {?>
						<tr class="dataLine  ">
							<td width="5%" class="checkBoxTd"><input type="checkbox" name="selectId[]" id="selectId<?php echo $row['id'];?>" class="selectCheckBox" value="<?php echo $row['id'];?>" /></td>
							<td><?php echo !empty($row['pageId']) ? $row['pageId'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['pageName']) ? $row['pageName'] : '&nbsp;';?></td>
							<td><?php 
								if ($row['pageType']==0){
									echo "页面";
								} else if ($row['pageType']==1){
									echo "弹窗";
								} else{
									echo "未知";
								}
							?></td>
							<td><?php echo $row['isMd']==1 ? "√": "×";?></td>
							<td><?php echo $row['isUseBi']==1 ? "√": "×";?></td>
							<td><?php echo $row['isUseManager']==1 ? "√": "×";?></td>
							<td><?php echo $row['isUserNow']==1 ? "<font class='green'>√</font>": "×";?></td>
							<td><?php echo $row['isLock']==1 ? "<font class='red'>锁定</font>": "正常";?></td>
							<td><?php echo $row['isFlag']==1 ? "√": "×";?></td>
							<td><?php echo !empty($row['mdVersion']) ? $row['mdVersion'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['note']) ? $row['note'] : '&nbsp;';?></td>
							<td><?php echo !empty($row['remark']) ? $row['remark'] : '&nbsp;';?></td>
							<td width="10%" class="checkBoxTd"><a href="<?php echo $this->projectUrl(array('action'=>'child-page-id-update', 'id'=>$row['id'],'childVersion'=>$row['childVersion'],'fieldType'=>$row['fieldType'], 'backUrl'=>urlencode($this->pageUrl))) ;?>">编辑</a></td>
						</tr>
<?php
}
?>
					</table>
<table class="controlTable">
						<tr>
							<td align="left">
								<input type="button" name="all" id="all" value="全选" class="button" onclick="$('.selectCheckBox').attr('checked', true);"/>
								<input type="button" name="cancel" id="cancel" value="取消" class="button" onclick="$('.selectCheckBox').attr('checked', false);"/>
								<select name="doType" id="doType">
								  <option value="del">删除选中</option>
								  <option value="isUseManager-yes">研发主管判定YES</option>
								  <option value="isUseManager-no">研发主管判定NO</option>
								  <option value="isUserNow-yes">当前埋点判定YES</option>
								  <option value="isUserNow-no">当前埋点判定NO</option>
								  <?php if (in_array($this->currentUserRow['userName'], $this->master['developer']) || $this->row['isLock']!=1){?>
								  <option value="isLock-yes">是否锁定YES</option>
								  <option value="isLock-no">是否锁定NO</option>
								  <?php }?>
								</select>
								<input type="submit" name="delete" id="delete" value="执行" class="button" onclick="return doSubmit();"/>
							</td>
							 <td colspan="6" align="right" class="paginator"><?php //echo $this->pageString;?></td>
					</tr>
					</table>
				</form>
			</div>
		</div>
</div>
<script language="javascript">
function doSubmit()
{	
	if ($('input[name=selectId[]]:checked').size() == 0 ) {
		alert('至少选择一项。');
		return false;
	}
	
	if (confirm('确定操作选中项吗？')){
		$('#listForm').attr('action', '<?php echo $this->projectUrl(array('action'=>'child-page-id-delete','childVersion'=>$this->vars['childVersion'],'fieldType'=>$this->vars['fieldType'],'backUrl'=>urlencode($this->pageUrl))) ;?>');
	}
	else{
		return false;
	}
}
</script>
</body>
</html>